
#pragma once

struct PidCompute{
    const float kp;
    const float ki;
    const float kd;
    float target;
    float actual;
    
    float error;
    float error_last;
    float error_last_last;
    float error_last_last_last;   
    float error_last_last_last_last;

    float integral;// 每次新的轨迹跟踪都需要将积分清零
    PidCompute(float kp, float ki, float kd);
    ~PidCompute();
    void IntegralSaturation(float &input, float max);
    float PidCtrl(float act, float tar);
    float incrementalPidCtrl(float act, float tar);
};